REST api with svelte client
This is a simple application that allows you to buy train tickets. The application is divided into two parts: the back-end and the front-end. The back-end is a REST api created with express.js and the front-end is a client created with svelte.js. The back-end is responsible for handling requests and responses, while the front-end is responsible for displaying the user interface.
- Node.js
- Express.js
- Svelte.js
- MongoDB
- In back-end directory create a
.envfile with the following content:
- DATABASE_URL (MongoDB connection string)
- PORT (Port number)
- JWT_SECRET (Secret key for JWT)
- SALT_ROUNDS (Number of rounds for bcrypt)
- Run
npm installoryarn installin each directory to install all dependencies. - Run
npm run startDevoryarn startDevin back-end directory to start the server. - Run
npm run devoryarn devin front-end directory to start the client in web browser.
- If you use yarn and you have python installed, you can run
python run.pyin the root directory to start both the server and the client(noyarn installneeded!).