Code Monkey home page Code Monkey logo

express-ts-api's Introduction

Express TS API

Documentation

Requirements

To install the project, you need to have Docker and Docker Compose installed on your machine.

To run the project, you need to have NodeJS installed on your machine, with the version 18.x.x or higher.

Commands

Install

This command will install the project and all its dependencies for the API and the frontend.

It will also create a .env file for the database, based on the .env file in the api folder.

At the end of the installation, it will create the docker containers for the database, the API and the frontend.

make install

Start

This command will run the docker containers for the database, the API and the frontend.

make start

Stop

This command will stop the docker containers for the database, the API and the frontend.

make stop

Restart

This command will restart the docker containers for the database, the API and the frontend.

make restart

Purify

This command will delete everything related to the project, to start again with a purify project.

make purify

Deploy

This command will deploy the project on the server.

make deploy

Other documentation

Structure

API

The API is built with Express and TypeScript.

The API structure is the following:

api
├── src
│   ├── config
│   ├── controllers
│   ├── database
│   ├── middlewares
│   ├── models
│   ├── routes
│   ├── services
│   ├── types
│   ├── utils

Specific documentation for the API can be found here.

Database

The database is a MariaDB database and we are using Sequelize as an ORM.

The database diagram is the following:

Diagram

Frontend

The frontend is built with Nuxt and TypeScript.

The frontend structure is the following:

frontend
├── src
│   ├── assets
│   ├── components
│   ├── layouts
│   ├── pages
│   ├── plugins
│   ├── public
│   ├── services
│   ├── store
│   ├── types

Specific documentation for the frontend can be found here.

Workflow

Connection to the admin panel

To connect to the admin panel, you need to go to the /admin route. You will be asked to enter a email and a password.

Create a session

Once you are connected to the admin panel, you can create a session by clicking on the Create a session button.

You will be asked to enter a name for the session and a duration for the session.

Once you have created the session, you will have a link to the session. You can copy this link and send it to the participants.

Join a session

To join a session, you need to go to the link that the admin sent you. You will be asked to enter a name and an email.

Once you have entered your name and email, you will receive an email with a magic link to join the session.

Do the exercises

Once the session has started, the participants will see the exercises that they need to do, one by one.

Test the exercises

Once the participants have done the exercises, they can test them by clicking on the Test button.

They will see the result of the test and the admin will see the result of the test in the admin panel. Which will display the notes of the participants.

End a session

The admin can end the session at any time by clicking on the End session button.

Admin panel

The admin panel is a dashboard that displays the participants connected to the session and the exercises that they have done. It also displays the notes of the participants.

The admin can also end the session at any time.

Challenge Answers

  1. Give access to your machine
    • Create a user and add the given SSH Public Key

Improvements

  • Add unit tests for the API
  • Add end-to-end tests for the frontend
  • Add a search bar for the admin panel
  • Add differents exercices that the admin can choose by creating a new session
  • Add a timer for the session to stop when the timer expires
  • Add a way to control who is connected to the session and block the access to the session if the user is not in the list

And many more...


Sami Lafrance | Paul Cotogno | Etienne Moureton | Pierre Keller | Augustin Vincent

express-ts-api's People

Contributors

neoxazrot avatar nexk0 avatar paulcotogno avatar ysarock avatar augustinkimi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.