Chitter is a Twitter clone app built with cutting-edge technologies including ReactJS, TypeScript, and TailwindCSS, featuring a user interface similar to Twitter.
The project showcases the effectiveness of TypeScript in building a type-safe, well-tested application. Custom hooks were developed to handle data fetching and form submission, and the app includes comprehensive end-to-end and unit tests using Cypress and Jest. Furthermore, the app integrates OpenAI API
to generate random comments for each peep.
Overall, this project represents a significant achievement in my development career, showcasing my expertise in building scalable and maintainable front-end applications using the latest technologies and development practices.
- ✅ User registration and login
- ✅ Ability to create, view, and delete peeps (tweets)
- ✅ Ability to like and unlike peeps
- ✅ Custom hooks for data fetching and form submission
- ✅ User interface based on the real Twitter for a familiar experience
- ✅ Integration of OpenAI API for generating random comments for each peep.
This project was built with the following tools:
This section shows you how to set up this project locally. First, get a local copy up and running follow these simple steps.
You have to make sure that npm
and node
have been installed in your local machine before running the project. If not, follow the steps below.
-
npm
npm install npm@latest -g npm -v
-
nvm & node
# visit https://github.com/nvm-sh/nvm on how to install nvm nvm install node node -v
-
Clone the repo
git clone https://github.com/terryhycheng/frontend-api-challenge.git cd frontend-api-challenge
-
Install NPM packages
npm install # OR yarn
-
Set Up
.env.local
In order to useOpenAI
, please add your API key to the file.VITE_OPENAI_API_KEY=
Before compiling the codes into production-ready Javascript, you should run the tests and make sure every line can be run without causing any errors.
-
Run Jest tests
npm run test # OR yarn test
-
Run Cypress tests
Please make sure
a dev server
is serving the front-end before running the following commands.# run cypress tests without GUI cypress run # with GUI npm run cypress # OR yarn cypress
Then, test coverage reports will be automatically generated in the folder coverage
. You can modify the setting in package.json
to remove the command --coverage
.
This project was built with Typescript
. You can use Vite
command to covert all TS codes into JS before passing to deployment.
-
Build with Typescript
npm run build # OR yarn build
All production-ready Javascript codes will be put in the folder dist
.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Terry Cheng - @terryhycheng - [email protected]
Project Link: https://github.com/terryhycheng/frontend-api-challenge