🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@harperfast/template-react-ts-studio

Package Overview
Dependencies
Maintainers
6
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harperfast/template-react-ts-studio

Your new app is now deployed and running on Harper Fabric!

latest
Source
npmnpm
Version
1.5.27
Version published
Weekly downloads
574
203.7%
Maintainers
6
Weekly downloads
 
Created
Source

your-project-name-here

Your new app is now deployed and running on Harper Fabric!

Here's what you should do next:

Define Your Schema

  • Create a new yourTableName.graphql file in the schemas directory.
  • Craft your schema by hand or tap "+ New Table" in the action bar for a bit of guidance.
  • Save your changes.
  • Tap "Restart Cluster" and your changes will be live!

These schemas are the heart of a great Harper app, specifying which tables you want and what attributes/fields they should have. Any table you @export stands up endpoints automatically.

Add Custom Endpoints

  • Create a new greeting.ts file in the resources directory.

  • Customize your resource:

    import { type RecordObject, type RequestTargetOrId, Resource } from 'harper';
    
    interface GreetingRecord {
    	greeting: string;
    }
    
    export class Greeting extends Resource<GreetingRecord> {
    	static loadAsInstance = false;
    
    	async post(
    		target: RequestTargetOrId,
    		newRecord: Partial<GreetingRecord & RecordObject>,
    	): Promise<GreetingRecord> {
    		// By default, only super users can access these endpoints.
    		return { greeting: 'Greetings, post!' };
    	}
    
    	async get(target?: RequestTargetOrId): Promise<GreetingRecord> {
    		// But if we want anyone to be able to access it, we can turn off the permission checks!
    		target.checkPermission = false;
    		return { greeting: 'Greetings, get! ' + process.version };
    	}
    
    	async put(
    		target: RequestTargetOrId,
    		record: GreetingRecord & RecordObject,
    	): Promise<GreetingRecord> {
    		target.checkPermission = false;
    		if (this.getCurrentUser()?.name?.includes('Coffee')) {
    			// You can add your own authorization guards, of course.
    			return new Response('Coffee? COFFEE?!', { status: 418 });
    		}
    		return { greeting: 'Sssssssssssssss!' };
    	}
    
    	async patch(
    		target: RequestTargetOrId,
    		record: Partial<GreetingRecord & RecordObject>,
    	): Promise<GreetingRecord> {
    		return { greeting: 'We can make this work!' };
    	}
    
    	async delete(target: RequestTargetOrId): Promise<boolean> {
    		return true;
    	}
    }
    
  • Save your changes.

  • Tap "Restart Cluster" and your changes will be live!

View Your Website

Pop open http://localhost:9926 to view web/index.html in your browser.

Use Your API

Head to the APIs tab to explore your endpoints and exercise them. You can click the "Authenticate" button to see what different users will be able to access through your API.

Test your application works by querying the /Greeting endpoint:

curl http://localhost:9926/Greeting

You should see the following:

{ "greeting": "Hello, world!" }

Configure Your App

Take a look at the default configuration, which specifies how files are handled in your application.

Keep Going!

For more information about getting started with Harper and building applications, see our getting started guide.

For more information on Harper Components, see the Components documentation.

FAQs

Package last updated on 04 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts