This project is a simple MERN aplication composed by two projects:
- back: a Express server which serves a simple CRUD API.
- front: a React app consuming the API.
The backend is an application bootstrapped from Express Generator which connects to a MongoDB database and performs CRUD operations.
- You can check the API documentation in /api.
- You can also check the database connection status in /health.
- Express: NodeJS web framework.
- Mongoose: ODM for MongoDB.
- Swagger UI: API's documentation.
The front is bootstrapped from Create React App. It is a simple SPA that lists all the users and allow the following actions:
- Create.
- Edit.
- Delete.
- React: JS frontend library.
- Redux: for state management.
- Material UI: React's components library that follows Google's Material Design Guidelines.
- Moment: JS library for date manipulation.
- Axios: promised based http client.
After you downloaded the files, you need to perform the following actions:
You must have Nodemon installed globally in order to run the back in dev mode.
In the back folder:
-
Run
npm install
in order to install al required packages. -
Create a .env file with the following values:
HOST=server_hostname
PORT=server_port
DB=database_connection_string
TESTDB=database_connection_string (*it will be a temporary database were tests will be done)
DBHOST=database_host
DBPORT=database_port
-
Run
npm run dev
to run it in development mode. -
You can also run some basic tests with
npm run test
.
In the front folder:
- Run
npm install
- Create a .env.development file with the value
REACT_APP_API=local_back_hostname
- Create a .env.production file with the value
REACT_APP_API=remote_back_hostname
- Run
npm start
You can see the project in action here: https://fullstack-coding-challenge.herokuapp.com/.