? Project summary
This challenge I realized consists of creating a message board where the user can register and/or authenticate only using the email, soon after logged in he can post a message on the wall and the message can be deleted. This application has a very simple design to just serve as a basis and show how it works.
To better understand the technologies that were used in this project, the backend and frontend were separated in the descriptions, below are the technologies:
First, let’s talk about the backend, it was created using Node.js, Typescript, Nest.js, GraphQL, Database SQLite the following dependencies:
Apollo Server Express – Is a community-maintained open-source GraphQL server that works with many Node.js HTTP server frameworks.
Data Loader – Is a generic utility to be used as part of your application’s data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.
Reflect Metadata – Allows you to do runtime reflection on types. The native (non reflect-metadata) version of type inference is much poorer than reflect-metadata and consists only of type and is instance
Rimraf– Is an executable that is used to clean the installed node packages in a node based project.
TypeGraphQL – Create GraphQL schema and resolvers with TypeScript, using classes and decorators!
Voyager – Is a static site generator with a built-in task runner, inspired by gulp and Google’s Web Starter Kit.
Prettier – Is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
Supertest – Module provides a high-level abstraction for testing HTTP, while still allowing you to go to the lower-level API provided by superagent.
Last but not least, let’s talk about the ** frontend**, it was created using React.js, Typescript, GraphQL, Apollo and the following dependencies :
? Local Installation
git clone https://github.com/jhonywalkeer/typescript-node.git $ cd messages-board $ cd backend $ npm install or yarn install $ cd frontend $ npm install or yarn install
To run the backend only:
$ cd messages-board $ cd backend # Development $ npm start or yarn start # Watch mode $ npm start:dev or yarn start:dev # Production mode $ npm start:prod or yarn start:prod
To run the GraphQL Playground available on the backend:
$ cd messages-board $ cd backend $ npm start or yarn start Access the link: http://localhost:3333/graphql
To test our backend:
$ cd messages-board $ cd backend # Unit tests $ npm test or yarn test # E2E tests $ npm test:e2e or yarn test:e2e # Test coverage $ npm test:cov or yarn test:cov
To run the database only:
To run the SQLite database in a simple way, there is a way to access the VSCode itself where you just need to install the extension SQLite from alexcvzz and perform the following steps:
- First of all, access the project through the VSCode:
$ cd messages-board $ cd backend $ cd code .
After accessing, press the shortcut keys
CTRL + SHIFT + P and type
sqlite (remember to have the extension installed because if it isn’t, it won’t work) and you will be presented with the following options:
Now select the option
SQLite: Open Database and select the database of the project which is named
There will be available a tab named
SQLITE EXPLORER and now you can view the database inside VSCode in a simple way
To run the frontend only:
$ cd messages-board $ cd frontend # Development $ npm start or yarn start # Production mode $ npm build or yarn build
This project is under license from MIT. See the LICENSE file for more details.