Skip to content

WildCodeSchool-2023-09/JS-RemoteFR-jurascripts-P3-Geocode

Repository files navigation

Logo

GEOCODE - Find an electric terminal

GEOCODE is a MVP(Minimum Viable Product) website that lists all the electrical terminals in France. Visitors can access the terminals of their choice, by entering a city, approved by the administrator. All the information needed to understand each terminal system is provided. Eventually, users will be able to reserve a terminal and create their own profile.

There are three levels of authenticated users:

  • Visitors > They can find electrical terminals.
  • Connected users (term users) > They can reserve a terminal.
  • Administrators > They can add and modify terminals.

map

Setup & Use

Here is the link to launch the MVP website directly : https://geocode.remote-6.wilders.dev/

Windows users

Be sure to run these commands in a git terminal to avoid issues with newline formats:

git config --global core.eol lf
git config --global core.autocrlf false

Project Initialization

In VSCode, install plugins Prettier - Code formatter and ESLint and configure them

Clone this repo, enter it:

git clone "[email protected]:WildCodeSchool-2023-09/JS-RemoteFR-jurascripts-P3-Geocode.git"

Install dependencies:

npm install
  • Create environment files (.env) in both backend and frontend: you can copy .env.sample files as starters (don't delete them) and modify data as required.

Run migrate scripts:

npm run db:migrate

Then move to the Back-End to launch the csv file (source of electrical terminals):

cd backend/ && npm run db:csv && cd ..

Run website:

npm run dev

Available Commands

  • db:migrate : Run the database migration script
  • db:seed : Run the database seed script
  • db:csv : Run the database csv script
  • dev : Starts both servers (frontend + backend) in one terminal
  • dev-front : Starts the React frontend server
  • dev-back : Starts the Express backend server
  • lint : Runs validation tools (will be executed on every commit, and refuse unclean code)

FAQ

Tools

  • cors : Safety for API
  • argon2 : Hashed passwords
  • jsonwebtoken : Generate tokens
  • papaparse : Transform .csv file into .json
  • @maptiler/sdk : Library linked to a map API
  • axios : Fetching an api into the backend
  • jwt-decode : Decoding tokens
  • usehooks-ts : Easier, lighter code
  • Concurrently : Allows for several commands to run concurrently in the same CLI
  • Husky : Allows to execute specific commands that trigger on git events
  • Vite : Alternative to Create-React-App, packaging less tools for a more fluid experience
  • ESLint : "Quality of code" tool, ensures chosen rules will be enforced
  • Prettier : "Quality of code" tool as well, focuses on the styleguide
  • _ Airbnb Standard_ : One of the most known "standards", even though it's not officially linked to ES/JS

Team Developers

  • Nelson Almeida
  • Xavier Mesnildrey
  • Valentin Cardon
  • Jordan Chatelain
  • Cedric Bodereau