The code in this repository is very similar to the starter code you'll be given to develop the backend for your social media app.
For the prep, you will only need to change src/concepts/websession.ts, but here's an overview of the repository setup:
app.tsholds our app definition using concepts. We'll discuss how to define an app using concepts in the next recitation.routes.tscontains REST API (we'll cover this in class soon) definitions for our concepts' actions and synchronizations.main.tscontains boilerplate code for setting up an Express app. In this file, we import our routes (which we defined inroutes.ts) for our concepts.- The
publicdirectory contains code for rendering the basic frontend where we can test our backend API operations. You won't need to modify anything within this directory for the purposes of this prep. - The
frameworkdirectory contains code for converting concept actions into Express handler functions. You shouldn't touch this. - The
conceptsdirectory is where you define and implement your concepts. Add a new.tsfile for each concept, where you'll add your concept actions. If you add new concepts (which we are NOT doing in this prep), remember to add the REST API definitions of the necessary actions as routes inroutes.tsand add your concept to your app definition inapp.ts. You'll also need to updatepublic/util.tswith your new operations to be able to test them.
- Run
npm install - Run
npm start - Navigate to
localhost:3000(or whichever port you see in the terminal).